﻿using System;
using SlamDunk.CMS.Model.DataModel;

namespace SlamDunk.CMS.Model.ViewModel
{
    /// <summary>
    /// User视图模型类
    /// </summary>
    [Serializable]
    public class UserView
    {
        #region 01.属性——Id
        /// <summary>
        /// 属性——Id
        /// </summary>
        public int Id { get; set; }
        #endregion

        #region 02.属性——UserName
        /// <summary>
        /// 属性——UserName
        /// </summary>
        public string UserName { get; set; }
        #endregion

        #region 03.属性——Password
        /// <summary>
        /// 属性——Password
        /// </summary>
        public string Password { get; set; }
        #endregion

        #region 04.属性——RealName
        /// <summary>
        /// 属性——RealName
        /// </summary>
        public string RealName { get; set; }
        #endregion

        #region 05.属性——PhoneNumber
        /// <summary>
        /// 属性——PhoneNumber
        /// </summary>
        public string PhoneNumber { get; set; }
        #endregion

        #region 06.属性——Email
        /// <summary>
        /// 属性——Email
        /// </summary>
        public string Email { get; set; }
        #endregion

        #region 07.属性——DelFlag
        /// <summary>
        /// 属性——DelFlag
        /// </summary>
        public bool DelFlag { get; set; }
        #endregion

        #region 08.属性——AddTime
        /// <summary>
        /// 属性——AddTime
        /// </summary>
        public DateTime AddTime { get; set; }
        #endregion

        #region 方法——转换为数据模型
        /// <summary>
        /// 转换为数据模型
        /// </summary>
        /// <returns>User数据模型对象</returns>
        public User ToDataModel()
        {
            return new User()
            {
                Id = this.Id,
                UserName = this.UserName,
                Password = this.Password,
                RealName = this.RealName,
                PhoneNumber = this.PhoneNumber,
                Email = this.Email,
                DelFlag = this.DelFlag,
                AddTime = this.AddTime,
            };
        }
        #endregion
    }
}
